<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->

<title>clearok</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_002_001_619">&nbsp;</a>NAME</h4><blockquote>
clearok, idlok, leaveok, scrollok, setscrreg,
wsetscrreg - terminal output control functions
</blockquote><h4><a name = "tag_002_001_620">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="curses.h.html">curses.h</a>&gt;

int clearok(WINDOW *<i>win</i>, bool <i>bf</i>);

int idlok(WINDOW *<i>win</i>, bool <i>bf</i>);

int leaveok(WINDOW *<i>win</i>, bool <i>bf</i>);

int scrollok(WINDOW *<i>win</i>, bool <i>bf</i>);

int setscrreg(int <i>top</i>, int <i>bot</i>);

int wsetscrreg(WINDOW *<i>win</i>, int <i>top</i>, int <i>bot</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_002_001_621">&nbsp;</a>DESCRIPTION</h4><blockquote>
These functions set options that deal with output within Curses.
<p>
The
<i>clearok()</i>
function assigns the value of
<i>bf</i>
to an internal flag in the specified window
that governs clearing of the screen during a refresh.  If, during a refresh
operation on the specified window, the flag in
<i>curscr</i>
is TRUE or the flag in the specified window is TRUE, then the implementation
clears the screen, redraws it in its entirety, and sets the flag to FALSE in
<i>curscr</i>
and in the specified window.  The initial state is unspecified.
<p>
The
<i><a href="idlok.html">idlok()</a></i>
function specifies whether the implementation may use the hardware
insert-line, delete-line, and scroll features of terminals so equipped.
If <i>bf</i> is TRUE, use of these features is enabled.
If <i>bf</i> is FALSE, use of these features is disabled
and lines are instead redrawn as required.  The initial state is FALSE.
<p>
The
<i><a href="leaveok.html">leaveok()</a></i>
function controls the cursor position after a refresh operation.
If <i>bf</i> is TRUE, refresh operations on the specified window
may leave the terminal's cursor at an arbitrary position.
If <i>bf</i> is FALSE, then at the end of any refresh operation,
the terminal's cursor is positioned at the cursor position contained in the
specified window.  The initial state is FALSE.
<p>
The
<i><a href="scrollok.html">scrollok()</a></i>
function controls the use of scrolling.
If <i>bf</i> is TRUE, then scrolling is enabled for the specified window,
with the consequences discussed in
<xref href=truncation><a href="intov.html#tag_001_004_002_002">
Truncation, Wrapping and Scrolling
</a></xref>.
If <i>bf</i> is FALSE, scrolling is disabled for the specified window.
The initial state is FALSE.
<p>
The
<i><a href="setscrreg.html">setscrreg()</a></i>
and
<i>wsetscrreg()</i>
functions define a software scrolling region in the current or specified
window.  The <i>top</i> and <i>bot</i> arguments are the line numbers of
the first and last line defining the scrolling region.  (Line 0 is the top
line of the window.)  If this option and
<i><a href="scrollok.html">scrollok()</a></i>
are enabled, an attempt to move off the last line of the margin causes all
lines in the scrolling region to scroll one line in the direction of the first
line.  Only characters in the window are scrolled.
If a software scrolling region is set and
<i><a href="scrollok.html">scrollok()</a></i>
is not enabled, an attempt to move off the last line of the margin does not
reposition any lines in the scrolling region.
</blockquote><h4><a name = "tag_002_001_622">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon successful completion,
<i><a href="setscrreg.html">setscrreg()</a></i>
and
<i>wsetscrreg()</i>
return OK.  Otherwise, they return ERR.
<p>
The other functions always return OK.
</blockquote><h4><a name = "tag_002_001_623">&nbsp;</a>ERRORS</h4><blockquote>
No errors are defined.
</blockquote><h4><a name = "tag_002_001_624">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
The only reason to enable the
<i><a href="idlok.html">idlok()</a></i>
feature is to use scrolling to achieve the visual effect of motion of a
partial window, such as for a screen editor.  In other cases, the feature can
be visually annoying.
<p>
The
<i><a href="leaveok.html">leaveok()</a></i>
option provides greater efficiency for applications that do not use the
cursor.
</blockquote><h4><a name = "tag_002_001_625">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="clear.html">clear()</a></i>,
<i><a href="delscreen.html">delscreen()</a></i>,
<i><a href="doupdate.html">doupdate()</a></i>,
<i><a href="scrl.html">scrl()</a></i>,
<i><a href="curses.h.html">&lt;curses.h&gt;</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
